﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ClassForWinForm
{
    public partial class Form18 : Form
    {
        DataTable dt;
        public Form18()
        {
            InitializeComponent();
        }

        private void Form18_Load(object sender, EventArgs e)
        {
            try
            {

                #region DataTable Data
                dt = new DataTable();
                dt.Columns.Add("C1");
                dt.Columns.Add("C2");
                dt.Columns.Add("C3");
                dt.Columns.Add("C4");
                dt.Columns.Add("C5");
                for (int i = 1; i < 101; i++)
                {
                    DataRow dr = dt.NewRow();
                    dr["C1"] = "Row" + i.ToString() + "C1";
                    dr["C2"] = "Row" + i.ToString() + "C2";
                    dr["C3"] = "Row" + i.ToString() + "C3";
                    dr["C4"] = "Row" + i.ToString() + "C4";
                    dr["C5"] = "Row" + i.ToString() + "C5";
                    dt.Rows.Add(dr);
                }
                dataGridView1.DataSource = dt;                
                #endregion

                pageGrid1.dataGridView1 = dataGridView1;
                pageGrid1.dt = dt;
                pageGrid1.Selectcount = 0;
                pageGrid1.GridViewPageLoad();

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
